package stars;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;

import view.ViewModule;

import modifiers.Feature;

import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Spatial;

import controller.PhysicalEventStrategyPack;
import controls.AbstractMasterControl;
import controls.GameControl;
import eventManager.AppEvent;
import eventManager.IEventListener;
import eventStrategies.ChangeViewStrategy;
import eventStrategies.GetStarTypeStrategy;
import eventStrategies.SetStarTypeStrategy;

public class StarControl extends AbstractMasterControl {

	private StarModel model;
	
	public StarControl(StarModel model, ViewModule views) {
		super(views);
		this.model = model;
		
		//load any special strategy packages here
		PhysicalEventStrategyPack.loadPhysicalEventStrategies(this, model.getPhysicalDataModel());
		//Continue...
				
		//load star-specific strategies
		loadSpecificEventStrategies();
		
	}

	@Override
	public GameControl cloneForSpatial(Spatial spatial) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void loadSpecificEventStrategies() {
		this.loadStrategy(new GetStarTypeStrategy());
		this.loadStrategy(new SetStarTypeStrategy());
		
		this.loadStrategy(new ChangeViewStrategy(nodes));
		this.loadStrategy(new MouseLeftClickStrategy());
	}
	
	private class MouseLeftClickStrategy implements IEventListener {
		
		private HashSet<String> eventTypes = new HashSet<String>();
		
		public MouseLeftClickStrategy() {
			eventTypes.add("MouseLeftClick");
		}

		@Override
		public void handleEvent(AppEvent event) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public Set<String> getEventTypes() {
			// TODO Auto-generated method stub
			return null;
		}
		
	}

	@Override
	protected void controlUpdate(float tpf) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void controlRender(RenderManager rm, ViewPort vp) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void write(JmeExporter ex) throws IOException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void read(JmeImporter im) throws IOException {
		// TODO Auto-generated method stub
		
	}

}
